package club.beimeng.testString;

public class TestString {
    public static void main(String[] args) {
        String abc1 = "abc";
        String abc2 = new String("abc");
        String abc3 = "ab" + "c";
        String abc4 = "abc";

        System.out.println("[\"abc\"]\t\t==\t[new String(\"abc\")] \t:"+(abc1==abc2));
        System.out.println("[\"ab\"+\"c\"]\t==\t[new String(\"abc\")] \t:"+(abc2==abc3));
        System.out.println("[\"abc\"]\t\t==\t[\"ab\"+\"c\"] \t\t\t\t:"+(abc1==abc3));
        System.out.println("[\"abc\"]\t\t==\t[\"abc\"] \t\t\t\t:"+(abc1==abc4));
    }
}
